#!/bin/bash
#
#
#启动算法服务
#-------------------------------
#人脸模拟变老
#-------------------------------
cd /data/webroot/TestSkin2.7
[ $? -eq 0 ] && echo "目录（/data/webroot/TestSkin2.7）切换成功\r\n" >> /root/TestSkin27.txt  || echo "目录（/data/webroot/TestSkin2.7）切换失败\r\n" >> /root/TestSkin27.txt
source  activate python27
[ $? -eq 0 ] && echo "成功进入容器(python27)\r\n" >> /root/TestSkin27.txt  || echo "进入容器(python27)失败\r\n" >> /root/TestSkin27.txt
nohup python main.py >> /dev/null &
[ $? -eq 0 ] && echo "(TestSkin2.7)服务开启成功\r\n" >> /root/TestSkin27.txt  || echo "服务开启失败\r\n" >> /root/TestSkin27.txt
source deactivate python27
[ $? -eq 0 ] && echo "(退出虚拟环境python27)成功\r\n" >> /root/TestSkin27.txt  || echo "退出虚拟环境(python27)失败\r\n" >> /root/TestSkin27.txt
#------------------------------
#/data/webroot/skinrun 算法
#------------------------------
cd /data/webroot/skinrun
[ $? -eq 0 ] && echo "目录（/data/webroot/skinrun）切换成功\r\n" >> /root/TestSkin27.txt  || echo "目录（/data/webroot/skinrun）切换失败\r\n" >> /root/TestSkin27.txt
source activate /root/anaconda2/envs/python36
[ $? -eq 0 ] && echo "成功进入容器(python36)\r\n" >> /root/TestSkin27.txt  || echo "进入容器(python36)失败\r\n" >> /root/TestSkin27.txt
nohup python run.py >> /dev/null &
[ $? -eq 0 ] && echo "(skinrun)服务开启成功\r\n" >> /root/TestSkin27.txt  || echo "服务(skinrun开启失败\r\n" >> /root/TestSkin27.txt
source deactivate python36
[ $? -eq 0 ] && echo "(退出虚拟环境python36)成功\r\n" >> /root/TestSkin27.txt  || echo "退出虚拟环境(python36)失败\r\n" >> /root/TestSkin27.txt
